<!--专家结论录入 -->
<template>
    <el-main>
        <el-main class="ep-body">
            <epl-top-bar :datas="{formData:form}" showPerson personType="PERSON_ALL_EXACT" psTagType="PERSON_INJURY_QUERY">
                <ep-button size="small" name="刷新"></ep-button>
            </epl-top-bar>
            <epl-userMessage dataType="person" idCount="4" >
            </epl-userMessage>

            <el-card class="ep-card">

                <el-form :model="form"  :rules="rules" >

                    <el-row :gutter="10">
                        <ep-input  label="人员id" name="aac001" :property="form.aac001"
                                   p="H"   :datas="{formData: form}" ></ep-input>
                        <ep-input  label="申报编号" name="bae506" :property="form.bae506"
                                   p="H"   :datas="{formData: form}" ></ep-input>
                        <ep-input  label="劳动能力鉴定id" name="baz500" :property="form.baz500"
                                   p="H"   :datas="{formData: form}" ></ep-input>
                        <ep-input  label="鉴定场次id" name="baz501" :property="form.baz501"
                                   p="H"   :datas="{formData: form}" ></ep-input>
                        <ep-select label="鉴定类别" name="bae508" :property="form.bae508" codetype="BAE508"
                                     p="H" :datas="{form: form}"></ep-select>
                    </el-row>
                    <el-row :gutter="10">
                        <ep-select colspan="8" label="是否延时鉴定" name="ys" :property="form.ys" codetype="SF"
                                   p="R" :datas="{form: form}"></ep-select>
                    </el-row>

                    <el-card  v-show="show1">
                        <ep-title >劳动能力鉴定</ep-title>
                        <el-row :gutter="10">
                            <ep-textarea  colspan="24" label="伤情介绍" name="elc050" :property="form.elc050"
                                          p="E"  :datas="{formData: form}" ></ep-textarea>
                        </el-row>
                        <el-row :gutter="10">
                            <ep-select colspan="24" label="申请主体" name="alc009" :property="form.alc009" codetype="ALC009"
                                       p="R"   :datas="{form: form}"></ep-select>
                        </el-row>
                        <el-row :gutter="10">
                            <ep-select colspan="24" label="伤残等级" name="ala040" :property="form.ala040" codetype="ALA040"
                                       p="R"   :datas="{form: form}"></ep-select>
                        </el-row>
                        <el-row :gutter="10">
                            <ep-checkbox colspan="24" label="护理依赖等级" name="alc060" :property="form.alc060" codetype="ALC060"
                                         p="R"   :datas="{form: form}"></ep-checkbox>
                        </el-row>
                        <el-row :gutter="10">
                            <ep-radio  colspan="8" label="进食" name="blc520" :property="form.blc520" codetype="SF"
                                       p="R"   :datas="{form: form}"></ep-radio >
                            <ep-radio  colspan="8" label="翻身" name="blc521" :property="form.blc521" codetype="SF"
                                       p="R"   :datas="{form: form}"></ep-radio >
                            <ep-radio  colspan="8" label="大小便" name="blc522" :property="form.blc522" codetype="SF"
                                       p="R"   :datas="{form: form}"></ep-radio >
                        </el-row>
                        <el-row :gutter="10">
                            <ep-radio  colspan="8" label="穿衣洗漱" name="blc523" :property="form.blc523" codetype="SF"
                                       p="R"   :datas="{form: form}"></ep-radio >
                            <ep-radio  colspan="8" label="自主行动" name="blc524" :property="form.blc524" codetype="SF"
                                       p="R"   :datas="{form: form}"></ep-radio >
                        </el-row>
                    </el-card>
                    <el-card  v-show="show2">
                        <ep-title >辅助器具确认</ep-title>
                        <el-row :gutter="10">
                            <ep-select colspan="8" label="辅助器具1" name="alc056" :property="form.alc056" codetype="ALC056"
                                       p="E"   :datas="{form: form}"></ep-select>
                            <ep-select colspan="8" label="辅助器具2" name="alc057" :property="form.alc057" codetype="ALC056"
                                       p="E"   :datas="{form: form}"></ep-select>
                            <ep-select colspan="8" label="辅助器具3" name="alc058" :property="form.alc058" codetype="ALC056"
                                       p="E"   :datas="{form: form}"></ep-select>
                        </el-row>
                    </el-card>
                    <el-card  v-show="show3">
                        <ep-title >旧伤复发确认</ep-title>
                        <el-row :gutter="10">
                            <ep-radio colspan="24" label="是否旧伤复发" name="alc063" :property="form.alc063" codetype="SF"
                                      p="R"   :datas="{form: form}"></ep-radio >
                        </el-row>
                    </el-card>
                    <el-card  v-show="show4">
                        <ep-title >康复治疗确认</ep-title>
                        <el-row :gutter="10">
                            <ep-date colspan="8" label="康复截止时间" name="blc068" :property="form.blc068" format="yyyyMMdd" value-format="yyyyMMdd"
                                     p="R"   :datas="{form: form}"></ep-date >
                            <ep-input colspan="8" label="康复期天数" name="blc562" :property="form.blc562"
                                      p="R"   :datas="{form: form}"></ep-input >
                        </el-row>
                    </el-card>
                    <el-card  v-show="show5">
                        <ep-title >停工留薪期延长确认</ep-title>
                        <el-row :gutter="10">
                            <ep-date colspan="8" label="停工留薪期延长日期" name="aae030" :property="form.aae030" format="yyyyMMdd" value-format="yyyyMMdd"
                                     p="R"   :datas="{form: form}"></ep-date >
                            <ep-date colspan="6" label="至" name="aae031" :property="form.aae031" format="yyyyMMdd" value-format="yyyyMMdd" label-width="30"
                                     p="E"   :datas="{form: form}"></ep-date >
                        </el-row>
                    </el-card>
                    <el-card  v-show="show6">
                        <ep-title >伤病因果关系确认</ep-title>
                        <el-row :gutter="10">
                            <ep-select colspan="8" label="是否存在因果关系" name="blc563" :property="form.blc563" codetype="BLC563"
                                       p="R"   :datas="{form: form}"></ep-select>
                            <ep-input colspan="8" label="确认" name="blc564" :property="form.blc564"
                                      p="R"   :datas="{form: form}"></ep-input >
                            <ep-input colspan="6" label="与" name="blc564s" :property="form.blc564s" label-width="30"
                                      p="E"   :datas="{form: form}"></ep-input >存在关联性

                        </el-row>
                    </el-card>
                    <el-card  >
                        <ep-title >丧失劳动能力</ep-title>
                        <el-row :gutter="10">
                            <ep-select colspan="10" label="丧失劳动能力等级" name="alc060S" :property="form.alc060S" codetype="ALC060"
                                       p="R"   :datas="{form: form}"></ep-select>
                        </el-row>
                    </el-card>

                     <el-card v-show="show01">
                        <el-row :gutter="10">
                            <ep-select colspan="24" label="鉴定依据" name="blc512" :property="form.blc512" codetype="BLC512"
                                       p="R"   :datas="{form: form}"></ep-select>
                        </el-row>
                    <el-row :gutter="10">
                        <ep-textarea  colspan="24" label="专家组意见" name="aae013" :property="form.aae013"
                                     p="E"   :datas="{form: form}"></ep-textarea >
                    </el-row>
                     </el-card>

                    <el-card v-show="show02">
                        <el-row :gutter="10">
                            <ep-select colspan="24" label="延期分类" name="blc514" :property="form.blc514" codetype="BLC514"
                                       p="R"   :datas="{form: form}"></ep-select>
                            <ep-select colspan="24" label="要增加的鉴定科别" name="blc504" :property="form.blc504" codetype="BLC504"
                                       p="R"   :datas="{form: form}"></ep-select>
                        </el-row>
                        <el-row :gutter="10">
                            <ep-textarea  colspan="24" label="延期原因" name="bae160" :property="form.bae160"
                                      p="E"   :datas="{form: form}"></ep-textarea >
                        </el-row>
                    </el-card>
                    <el-row :gutter="10">
                        <ep-select colspan="24" label="专家组成员" name="blc515" :property="form.blc515" codetype="BLC515"
                                  p="R"   :datas="{form: form}"></ep-select>
                    </el-row>
                    <el-row type="flex" justify="center" >
                        <ep-saveButton id="" top="20" type="primary" bottom="20"
                                       :datas="{formData: form}" name="保存"></ep-saveButton>
                        <ep-Button id="" top="20" type="primary" bottom="20"
                                   name="清空"></ep-Button>
                    </el-row>
                </el-form>
            </el-card>
        </el-main>

    </el-main>

</template>
<script type="es6">
    export default {
        data() {
            return {
                form:{
                    aac001: {
                        value: '',
                        p: 'H'
                    },
                    bae506: {
                        value: '',
                        p: 'H'
                    },
                    baz500: {
                        value: '',
                        p: 'H'
                    },
                    baz501: {
                        value: '',
                        p: 'H'
                    },
                    bae508: {
                        key: '',
                        value: '',
                        p: 'H'
                    },
                    ys: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    elc050: {
                        value: '',
                        p: 'E'
                    },
                    alc009: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    ala040: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc060: {
                        key: [],
                        value: []
                    },
                    blc520: {
                        value: '',
                        p: 'R'
                    },
                    blc521: {
                        value: '',
                        p: 'R'
                    },
                    blc522: {
                        value: '',
                        p: 'R'
                    },
                    blc523: {
                        value: '',
                        p: 'R'
                    },
                    blc524: {
                        value: '',
                        p: 'R'
                    },
                    blc512: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc056: {
                        key: '',
                        value: '',
                        p: 'E'
                    },
                    alc057: {
                        key: '',
                        value: '',
                        p: 'E'
                    },
                    alc058: {
                        key: '',
                        value: '',
                        p: 'E'
                    },
                    alc063: {
                        value: '',
                        p: 'R'
                    },
                    blc068: {
                        value: '',
                        p: 'R'
                    },
                    blc562: {
                        value: '',
                        p: 'R'
                    },
                    aae030: {
                        value: '',
                        p: 'R'
                    },
                    aae031: {
                        value: '',
                        p: 'E'
                    },
                    blc563: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    blc564: {
                        value: '',
                        p: 'R'
                    },
                    blc564s: {
                        value: '',
                        p: 'E'
                    },
                    alc060S: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    aae013: {
                        value: '',
                        p: 'E'
                    },
                    blc514: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    blc504: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    bae160: {
                        value: '',
                        p: 'E'
                    },
                    blc515: {
                        key: '',
                        value: '',
                        p: 'R'
                    },

                },

                rules:{
                    ys: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    alc009: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    ala040: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    alc060: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    blc520: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    blc521: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    blc522: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    blc523: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    blc524: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    blc512: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    alc063: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    blc068: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    blc562: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    aae030: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    blc563: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    blc564: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    alc060S: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    blc514: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    blc504: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    blc515: [
                        {required: true, message: '必填项，不能为空'}

                    ],

                },
                codeTypes:{
                    BAE508:[],
                    SF:[],
                    ALC009:[],
                    ALA040:[],
                    ALC060:[],
                    BLC512:[],
                    ALC056:[],
                    BLC563:[],
                    BLC514:[],
                    BLC504:[],
                    BLC515:[],

                },
                pager: {
                    page: 1,
                    size: 10
                },
                total: 0,
            }
        },
        computed: {
            functionId() {
                if (this.$store.getters.init.path !== this.$route.path) return;
                if (this.$store.getters.init.mdParam === null || this.$store.getters.init.mdParam === undefined) return;
                if (this.$store.getters.init.mdParam.functionid === undefined) return;
                return this.$store.getters.init.mdParam.functionid;
            },
            backFun() {
                return this.$store.getters.backFun;
            },
            init_formData() {
                if (this.$store.getters.init.path !== this.$route.path)  return;
                return this.$store.getters.init.form;
            },
            doInitformData: {
                get: function () {
                    if (this.$store.getters.common === null) return [];
                    if (this.$store.getters.common.path !== this.$route.path) return;
                    return this.$store.getters.common.formData;
                },
                set: function (newValue) {
                    if (newValue.path !== this.$route.path) return;
                    return newValue;
                }
            },
            init_form() {
                if (this.$store.getters.init.path !== this.$route.path)  return;
                return this.$store.getters.init.form;
            },
            doInitform: {
                get: function () {
                    if (this.$store.getters.common === null) return [];
                    if (this.$store.getters.common.path !== this.$route.path) return;
                    return this.$store.getters.common.form;
                },
                set: function (newValue) {
                    if (newValue.path !== this.$route.path) return;
                    return newValue;
                }
            },
            show1() {
                if (this.$store.getters.common === null) return [];
                return this.$store.getters.common.show1;
            },
            show2() {
                if (this.$store.getters.common === null) return [];
                return this.$store.getters.common.show2;
            },
            show3() {
                if (this.$store.getters.common === null) return [];
                return this.$store.getters.common.show3;
            },
            show4() {
                if (this.$store.getters.common === null) return [];
                return this.$store.getters.common.show4;
            },
            show5() {
                if (this.$store.getters.common === null) return [];
                return this.$store.getters.common.show5;
            },
            show6() {
                if (this.$store.getters.common === null) return [];
                return this.$store.getters.common.show6;
            },
            show7() {
                if (this.$store.getters.common === null) return [];
                return this.$store.getters.common.show7;
            },
            show01() {
                if (this.$store.getters.common === null) return [];
                return this.$store.getters.common.show01;
            },
            show02() {
                if (this.$store.getters.common === null) return [];
                return this.$store.getters.common.show02;
            },

        },
        created() {
            let param = {
                path: this.$route.path,
                codeTypes:this.codeTypes,
                form:this.form

            };
            this.$store.dispatch('SET_INIT', param);
        },
        watch: {
            init_formData: {
                handler(value) {
                    if (value == undefined) return;
                    this.getformData(value);
                },
                deep: true
            },
            doInitformData: {
                handler(value) {
                    if (value == undefined) return;
                    this.getformData(value);
                },
                deep: true
            },
            init_form: {
                handler(value) {
                    if (value == undefined) return;
                    this.getform(value);
                },
                deep: true
            },
            doInitform: {
                handler(value) {
                    if (value == undefined) return;
                    this.getform(value);
                },
                deep: true
            },
            show1: {
                handler(value) {
                    if (value == undefined) return false;
                    return value;
                },
                deep: true
            },
            show2: {
                handler(value) {
                    if (value == undefined) return false;
                    return value;
                },
                deep: true
            },
            show3: {
                handler(value) {
                    if (value == undefined) return false;
                    return value;
                },
                deep: true
            },
            show4: {
                handler(value) {
                    if (value == undefined) return false;
                    return value;
                },
                deep: true
            },
            show5: {
                handler(value) {
                    if (value == undefined) return false;
                    return value;
                },
                deep: true
            },
            show6: {
                handler(value) {
                    if (value == undefined) return false;
                    return value;
                },
                deep: true
            },
            show7: {
                handler(value) {
                    if (value == undefined) return false;
                    return value;
                },
                deep: true
            },
            show01: {
                handler(value) {
                    if (value == undefined) return false;
                    return value;
                },
                deep: true
            },
            show02: {
                handler(value) {
                    if (value == undefined) return false;
                    return value;
                },
                deep: true
            },

            backFun: {
                handler(value) {
                    if (value === null) return;
                    this.customBackFun();
                    let backFun = [];
                    backFun = value.split(',');
                    if (backFun.indexOf('rDoInit') >= 0) {
                        let codeTypes = {
                            BAE508:[],
                            SF:[],
                            ALC009:[],
                            ALA040:[],
                            ALC060:[],
                            BLC512:[],
                            ALC056:[],
                            BLC563:[],
                            BLC514:[],
                            BLC504:[],
                            BLC515:[],

                        };
                        let form = {
                            aac001: {
                                value: '',
                                p: 'H'
                            },
                            bae506: {
                                value: '',
                                p: 'H'
                            },
                            baz500: {
                                value: '',
                                p: 'H'
                            },
                            baz501: {
                                value: '',
                                p: 'H'
                            },
                            bae508: {
                                key: '',
                                value: '',
                                p: 'H'
                            },
                            ys: {
                                key: '',
                                value: '',
                                p: 'R'
                            },
                            elc050: {
                                value: '',
                                p: 'E'
                            },
                            alc009: {
                                key: '',
                                value: '',
                                p: 'R'
                            },
                            ala040: {
                                key: '',
                                value: '',
                                p: 'R'
                            },
                            alc060: {
                                key: [],
                                value: []
                            },
                            blc520: {
                                value: '',
                                p: 'R'
                            },
                            blc521: {
                                value: '',
                                p: 'R'
                            },
                            blc522: {
                                value: '',
                                p: 'R'
                            },
                            blc523: {
                                value: '',
                                p: 'R'
                            },
                            blc524: {
                                value: '',
                                p: 'R'
                            },
                            blc512: {
                                key: '',
                                value: '',
                                p: 'R'
                            },
                            alc056: {
                                key: '',
                                value: '',
                                p: 'E'
                            },
                            alc057: {
                                key: '',
                                value: '',
                                p: 'E'
                            },
                            alc058: {
                                key: '',
                                value: '',
                                p: 'E'
                            },
                            alc063: {
                                value: '',
                                p: 'R'
                            },
                            blc068: {
                                value: '',
                                p: 'R'
                            },
                            blc562: {
                                value: '',
                                p: 'R'
                            },
                            aae030: {
                                value: '',
                                p: 'R'
                            },
                            aae031: {
                                value: '',
                                p: 'E'
                            },
                            blc563: {
                                key: '',
                                value: '',
                                p: 'R'
                            },
                            blc564: {
                                value: '',
                                p: 'R'
                            },
                            blc564s: {
                                value: '',
                                p: 'E'
                            },
                            alc060S: {
                                key: '',
                                value: '',
                                p: 'R'
                            },
                            aae013: {
                                value: '',
                                p: 'E'
                            },
                            blc514: {
                                key: '',
                                value: '',
                                p: 'R'
                            },
                            blc504: {
                                key: '',
                                value: '',
                                p: 'R'
                            },
                            bae160: {
                                value: '',
                                p: 'E'
                            },
                            blc515: {
                                key: '',
                                value: '',
                                p: 'R'
                            },

                        };

                        let param = {
                            path: this.$route.path,
                            codeTypes:codeTypes,
                            form:form

                        };
                        this.$store.dispatch('SET_INIT', param);
                    }
                }
            }
        },
        methods: {
            getformData(value) {
                this.form = value;
            },
            getform(value) {
                this.form = value;
            },

            handleSizeChange(val) {
                console.log(`每页 ${val} 条`);
            },
            handleCurrentChange(val) {
                console.log(`当前页: ${val}`);
            },
            handleEdit(id) {
                this.dialogFormVisible = true;
            },
            customBackFun(){//自定义方法体
            },
        },
    }
</script>
